/**
 * Agent interface used by AgentPlatform when sending and receiving 
 * agents. Insures classes implementing this interface contain the 
 * requires methods to be transfered and updated as required.
 * @ author Francis and Aidan
 */
package agent;

public interface Agent {
	
	public static final String TYPE_MEETING = "MEETING";
	public static final String TYPE_INFORMATION= "INFORMATION";

	/**
	 * @return the agent's type
	 */
	public String getType();
	
	/**
	 * @param n: index of the contact to be returned
	 * @return the contact at index n
	 */	
	public String getContact(int n);
	/**
	 * @param n: index of the address to be returned
	 * @return the address at index n
	 */
	public String getAddresses(int n);
	
	/**
	 * Used to update the nextAddressIndex
	 */
	public void incrementToNextAddress();
	
	/**
	 * read in all the agent's values from a string
	 * the order in which they are read in is important and should 
	 * be matched with the toString method
	 * 
	 * @param agentString: delimited string containing agent's attributes
	 */
	public void fromString( String agentString );
	
	/**
	 * the toString method writes out all the agents values 
	 * the order in which they are written out is important and should 
	 * be matched with the fromString method
	 * 
	 * @return agentString: the agent in delimited string form
	 **/
	public String toString();
	
	/**
	 * @return address: the address agent is to be sent to next
	 */
	public String getNextAddress();
	/**
	 * @return port: the port agent is to be sent to next
	 */
	public int getNextPort();	
}